package com.jack.design_patterns.structural.decorator.schoolgrade_demo;

/**
 * 装饰成绩单的抽象类
 */
public abstract class Decorator extends SchoolReport {

    // 定义要装饰的成绩单
    private SchoolReport schoolReport;

    /**
     * 构造方法, 传入被装饰的成绩单
     * @param schoolReport
     */
    public Decorator(SchoolReport schoolReport) {
        this.schoolReport = schoolReport;
    }

    /**
     * 展示成绩单
     */
    @Override
    public void report() {
        this.schoolReport.report();
    }

    /**
     * 家长签名
     * @param parentName
     */
    @Override
    public void sign(String parentName) {
        this.schoolReport.sign(parentName);
    }

}
